﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using DbGenerator.Model.units.column;

namespace DbExecuter.DataLayer.commands
{
    public class TCommandParameter
    {
        #region ctors
        public TCommandParameter(TColumn baseColumn)
        {
            _BaseColumn = baseColumn;
            _ParameterName = Guid.NewGuid().ToString().Replace("-", "");
            _SqlParameter
                = new SqlParameter(_ParameterName, baseColumn.DataValue);
        }
        #endregion

        #region public methods
        public void SetValue(object value)
        {
            _SqlParameter.Value = value;
        }
        #endregion

        #region properties
        private TColumn _BaseColumn;

        private string _ParameterName;
        public string ParameterName
        {
            get { return _ParameterName; }
        }
       
        private SqlParameter _SqlParameter;
        public SqlParameter SqlParameter
        {
            get { return _SqlParameter; }
        }
        #endregion
    }
}
